home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5459 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.os.msdos.programmer,comp.lang.c
  4. Subject: Re: open vs fopen?
  5. Date: 8 Feb 96 02:58:32 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.823748312@rscernix>
  8. References: <uEYFxc9nX8WX083yn@mbnet.mb.ca> <4f8bev$6tr@hermes.louisville.edu> <4fbfno$7f@noc.tor.hookup.net>
  9. NNTP-Posting-Host: hpl3sn04.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <4fbfno$7f@noc.tor.hookup.net> Rajendra_Singh@msn.com (Rajendra Singh) writes:
  13.  
  14. >gclind01@starbase.spd.louisville.edu (George C. Lindauer) wrote:
  15. >
  16. >>The only reason I know of is UNIX portability.  Whenever I run across a
  17. >>unix program that uses the old-style open instead of fopen I usually
  18. >>end up rewriting it anyway though; I've had so many problems with
  19. >>the unix-style stuff I just rather would deal with the ANSI style.
  20. >
  21. >That's incorrect.  fopen() is used for buffered I/O!  open() is not a
  22. >UNIX specific function nor is it non-ANSI!
  23.  
  24. That's incorrect.  open() is a Unix-specific function (even if it was
  25. emulated on other systems) and it IS non-ANSI!
  26.  
  27. BTW, in Unix both open() and fopen() are used for buffered I/O!  fopen()
  28. adds an _additional_ level of buffering in order to minimize the number 
  29. of read/write system calls.  The kernel is doing its own buffering
  30. for read/write operations.
  31.  
  32. Dan
  33. --
  34. Dan Pop
  35. CERN, CN Division
  36. Email: danpop@mail.cern.ch 
  37. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  38.